﻿<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" trimDirectiveWhitespaces="true"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib prefix="ctp" uri="http://www.seeyon.com/ctp"%>
<c:set var="path" value="${pageContext.request.contextPath}" />
 
function kkToSapMateriel(name){
		var list = [];
  		 var isOk = true;
  		 var $allCombox = $('#mytable input:checked');
  		 if($allCombox.length != 1){
  		 	$.alert("请选择一条数据!");
  		 	return;
  		 }
  		 
  		 $allCombox.each(function(i){
	     	list[i] = $(this).val();
	     });
	     
	     var mainConfirm = (function(resp){
	     	var json = SEEYON_UTILS.jsonEval(resp);
	       $.alert(json.message);	       
     	 });
	     
    if(confirm('确定将选中记录推送SAP?')){
	     var url='${path}/toSap'+name+'.do?method=toSap';
	     SEEYON_UTILS.loadUrl(url, {"search_id":list[0]}, 'POST', true,mainConfirm);	     
  	}
}
 


jQuery(document).ready(
  function(){
  var buttonStr='<em class="seperate margin_lr_5"></em>'+
  '<a href="javascript:{btnAction}" id="cust_0_a">'+
  '<em id="cust_0_em" class="ico16 editor_16"></em>'+
  '<span id="cust_0_span" class="menu_span" title="${btnName}">{btnName}</span></a>';
  
	<%-----手工抛送SAP物料：593548644027747110--%>
  	<c:if test="${param.formId==593548644027747110}">
       var buttonStr1=buttonStr.replaceAll('{btnName}', 'SAP推送').replaceAll('{btnAction}','kkToSapMateriel(\'Materiel\')');
       $("#toolbarArea .common_toolbar_box .toolbar_l div:first").append(buttonStr1);
    </c:if>
    <%-----手工抛送SAP物料：593548644027747110--%>
    
    	<%-----手工抛送SAP客戶信息：1597089104805054922--%>
  	<c:if test="${param.formId==1597089104805054922}">
       var buttonStr1=buttonStr.replaceAll('{btnName}', 'SAP推送').replaceAll('{btnAction}','kkToSapMateriel(\'Customer\')');
       $("#toolbarArea .common_toolbar_box .toolbar_l div:first").append(buttonStr1);
    </c:if>
    <%-----手工抛送SAP客戶信息：1597089104805054922--%>
    
    	<%-----手工抛送SAP销售价格：-8117633679550036412--%>
  	<c:if test="${param.formId==-8117633679550036412}">
       var buttonStr1=buttonStr.replaceAll('{btnName}', 'SAP推送').replaceAll('{btnAction}','kkToSapMateriel(\'SalePrice\')');
       $("#toolbarArea .common_toolbar_box .toolbar_l div:first").append(buttonStr1);
    </c:if>
    <%-----手工抛送SAP销售价格：-8117633679550036412--%>
     
    <%-----手工抛送SAP供应商信息：996077627077774883--%>
  	<c:if test="${param.formId==996077627077774883}">
       var buttonStr1=buttonStr.replaceAll('{btnName}', 'SAP推送').replaceAll('{btnAction}','kkToSapMateriel(\'Supplier\')');
       $("#toolbarArea .common_toolbar_box .toolbar_l div:first").append(buttonStr1);
    </c:if>
    <%-----手工抛送SAP供应商信息：996077627077774883--%> 
    
     <%-----手工抛送SAP采购申请信息：-8702922974100960104--%>
  	<c:if test="${param.formId==-8702922974100960104}">
       var buttonStr1=buttonStr.replaceAll('{btnName}', 'SAP推送').replaceAll('{btnAction}','kkToSapMateriel(\'CaiGou\')');
       $("#toolbarArea .common_toolbar_box .toolbar_l div:first").append(buttonStr1);
    </c:if>
    <%-----手工抛送SAP采购申请信息：-8702922974100960104--%> 
  } 
) 